package com.imooc.user.service;


import com.imooc.user.pojo.Users;
import com.imooc.user.pojo.bo.UserBo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * @Author: 顾志杰
 * @Date: 2019/11/13
 * @Time: 15:10
 */
@FeignClient("foodie-user-service")
@RequestMapping("user-api")
public interface UserService {

    /**
     * 判断用户是否纯在
     * @param username
     * @return
     */
    @GetMapping("user/exist")
    boolean queryUserNameIsExist(@RequestParam("username") String username);

    /**
     * 创建用户
     * @param userBo
     * @return
     */
    @PostMapping("user")
    Users createUser(@RequestBody UserBo userBo);

    /**
     * 检索用户名密码是否匹配 用于登录
     * @param username
     * @param password
     * @return
     */
    @GetMapping("verify")
    Users queryUserForLogin(@RequestParam("username") String username,
                            @RequestParam("password") String password);
}
